﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace RKConsulting.Web.Helpers
{
    public static class CacheHelper
    {
        public static void Add<T>(string key, T value)
        {
            HttpRuntime.Cache[key] = value;
        }

        public static T Get<T>(string key)
        {
            var obj = HttpRuntime.Cache[key];
            if (obj == null)
                return default(T);

            return (T)obj;
        }

        public static void Remove(string key)
        {
            HttpRuntime.Cache.Remove(key);
        }
    }
}
